package summary;

import java.util.*;

/**
 * @Author: 海琳琦
 * @Date: 2022/7/18 20:59
 */
public class Title179 {

    public static String largestNumber(int[] nums) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < nums.length; i++) {
            list.add(nums[i]);
        }
        Collections.sort(list, (a,b)->{
            String A = String.valueOf(a);
            String B = String.valueOf(b);
            return (B + A).compareTo(A + B);
        });
        if (list.get(0) == 0) {
            return "0";
        }
        StringBuilder result = new StringBuilder();
        for (Integer a : list) {
            result.append(a);
        }
        return result.toString();
    }

    public static void main(String[] args) {
        System.out.println(Integer.compare(3, 30));
        int[] arr = {111311, 1113};
        largestNumber(arr);
    }
}
